package com.yanqu.road.logic.bussiness.player;

import com.yanqu.road.logic.bussiness.DaoHelper;
import com.yanqu.road.entity.player.UserInfo;
import com.yanqu.road.entity.player.UserServerInfo;
import com.yanqu.road.entity.web.WebLoginParam;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;

public class UserBussiness {

    public static boolean updateBugGoldSpeed(UserInfo userInfo) {
        return DaoHelper.getUserDaoImpl().updateBugGoldSpeed(userInfo);
    }

    public static Map<Long, UserInfo> getBugUserInfoMap(String where) {
        return DaoHelper.getUserDaoImpl().getBugUserInfoMap(where);
    }

    public static Map<Long, UserInfo> getUserInfoMap() {
        return DaoHelper.getUserDaoImpl().getUserInfoMap();
    }

    public static Map<Long, UserInfo> getUserInfoMapWithTitleId(int titleId) {
        return DaoHelper.getUserDaoImpl().getUserInfoMapWithTitleId(titleId);
    }

    public static UserInfo getUserInfoByUserId(long userId) {
        return DaoHelper.getUserDaoImpl().getUserInfoByUserId(userId);
    }

    public static UserInfo getUserInfoPreByUserId(long userId) {
        return DaoHelper.getUserDaoImpl().getUserInfoPreByUserId(userId);
    }

    public static UserInfo getUserInfoByUserId(long userId, String openId) {
        return DaoHelper.getUserDaoImpl().getUserInfoByUserId(userId, openId);
    }

    public static UserInfo register(WebLoginParam loginParam, long userId, long userAliasId, int hideVipAddress) {
        return DaoHelper.getUserDaoImpl().register(loginParam, userId, userAliasId, hideVipAddress);
    }

    public static UserInfo registerFromPre(UserInfo preUserInfo) {
        return DaoHelper.getUserDaoImpl().registerFromPre(preUserInfo);
    }

    public static UserInfo registerPre(WebLoginParam loginParam, long userId, long userAliasId, int hideVipAddress) {
        return DaoHelper.getUserDaoImpl().registerPre(loginParam, userId, userAliasId, hideVipAddress);
    }

    public static boolean registerPreServer(String openId, long userId,long serverId) {
        return DaoHelper.getUserDaoImpl().registerPreServer(openId, userId,serverId);
    }

    public static boolean updatePreServer(String nickName, long userId) {
        return DaoHelper.getUserDaoImpl().updatePreServer(nickName, userId);
    }

    public static boolean updateUserInfo(UserInfo userInfo) {
        return DaoHelper.getUserDaoImpl().update(userInfo);
    }

    public static boolean updateUserMark(long userId, String userMark) {
        return DaoHelper.getUserDaoImpl().updateUserMark(userId, userMark);
    }

    public static boolean isSameNickName(String nickName) {
        return DaoHelper.getUserDaoImpl().isSameNickName(nickName);
    }

	public static boolean updateForbid(long userId, long blackListEndTime) {
		return DaoHelper.getUserDaoImpl().updateForbid(userId, blackListEndTime);
	}

    public static boolean updateNickName(long userId, String nickName) {
        return DaoHelper.getUserDaoImpl().updateNickName(userId, nickName);
    }

    public static boolean updateUnionUid(long userId, String unionUid) {
        return DaoHelper.getUserDaoImpl().updateUnionUid(userId, unionUid);
    }

    public static boolean updateUserPlatformUserId(long userId, String platformUserId, String platformUserName) {
        return DaoHelper.getUserDaoImpl().updateUserPlatformUserId(userId, platformUserId, platformUserName);
    }

    public static boolean updateUserRoleInfo(long userId, short sex, String nickName, String decoration) {
        return DaoHelper.getUserDaoImpl().updateUserRoleInfo(userId, sex, nickName, decoration);
    }

    public static boolean updatePreUserRoleInfo(long userId, short sex, String nickName, String decoration) {
        return DaoHelper.getUserDaoImpl().updatePreUserRoleInfo(userId, sex, nickName, decoration);
    }

    public static boolean updateHeartCountAndEarnSpeed(long userId, int heartCount, BigInteger earnSpeed) {
        return DaoHelper.getUserDaoImpl().updateHeartCountAndEarnSpeed(userId, heartCount, earnSpeed);
    }

    public static boolean updateLastHeartRecoverTimeAndEarnSpeed(long userId, int heartCount, long lastHeartRecoverTime, BigInteger earnSpeed) {
        return DaoHelper.getUserDaoImpl().updateLastHeartRecoverTimeAndEarnSpeed(userId, heartCount, lastHeartRecoverTime, earnSpeed);
    }

    public static boolean updateHeartCountAndEarnSpeedAndHateTimes(long userId, int heartCount, BigInteger earnSpeed, int beHateTimes) {
        return DaoHelper.getUserDaoImpl().updateHeartCountAndEarnSpeedAndHateTimes(userId, heartCount, earnSpeed, beHateTimes);
    }

    public static boolean updateLastHeartRecoverTimeAndEarnSpeedAndHateTimes(long userId, int heartCount, long lastHeartRecoverTime, BigInteger earnSpeed, int beHateTimes) {
        return DaoHelper.getUserDaoImpl().updateLastHeartRecoverTimeAndEarnSpeedAndHateTimes(userId, heartCount, lastHeartRecoverTime, earnSpeed, beHateTimes);
    }

    public static boolean updateChildEarnSpeed(long userId, BigInteger childEarnSpeed) {
        return DaoHelper.getUserDaoImpl().updateChildEarnSpeed(userId, childEarnSpeed);
    }

    public static boolean updateForbidSpeak(long userId, long forbiddenSpeakEndTime) {
        return DaoHelper.getUserDaoImpl().updateForbidSpeak(userId, forbiddenSpeakEndTime);
    }

    public static boolean updateAdmin(long userId, boolean isAdmin) {
        return DaoHelper.getUserDaoImpl().updateAdmin(userId, isAdmin);
    }

    public static long getMaxUserId() {
        return DaoHelper.getUserDaoImpl().getMaxUserId();
    }

    public static long getMaxUserIdPre() {
        return DaoHelper.getUserDaoImpl().getMaxUserIdPre();
    }


    public static List<UserServerInfo> getUserServerList(String openId) {
        return DaoHelper.getUserDaoImpl().getUserServerList(openId);
    }

    public static List<Long> getUserPreServerList(String openId) {
        return DaoHelper.getUserDaoImpl().getUserPreServerList(openId);
    }

    public static UserInfo getUserInfoByOpenIdAndServerId(String openId, long serverId) {
        return DaoHelper.getUserDaoImpl().getUserInfoByOpenIdAndServerId(openId, serverId);
    }

    public static List<UserInfo> getUserInfoList(String openId) {
        return DaoHelper.getUserDaoImpl().getUserInfoList(openId);
    }

    public static UserInfo getUserInfoByUserAliasId(long userAliasId) {
        return DaoHelper.getUserDaoImpl().getUserInfoByUserAliasId(userAliasId);
    }

    public static UserInfo getUserInfoByOpenIdAndPhonePlatform(String openId, int phonePlatform, long serverId) {
        return DaoHelper.getUserDaoImpl().getUserInfoByOpenIdAndPhonePlatform(openId, phonePlatform, serverId);
    }

    public static List<UserInfo> getUserInfosByOpenIdAndServerId(String openId, long serverId) {
        return DaoHelper.getUserDaoImpl().getUserInfosByOpenIdAndServerId(openId, serverId);
    }

    public static UserInfo getPreUserInfosByOpenIdAndServerId(String openId, long serverId) {
        return DaoHelper.getUserDaoImpl().getPreUserInfosByOpenIdAndServerId(openId, serverId);
    }

    //必须是完整的创角，取完名字的
    public static UserInfo getPreUserInfosByOpenIdFull(String openId, long serverId) {
        return DaoHelper.getUserDaoImpl().getPreUserInfosByOpenIdFull(openId, serverId);
    }

    public static int getUserCountByOpenId(String openId) {
        return DaoHelper.getUserDaoImpl().getUserCountByOpenId(openId);
    }

    public static boolean updateLastManorHelpRecoverTimeAndCount(long helpUserId, long recoverTime ,int manorHelpCount) {
        return DaoHelper.getUserDaoImpl().updateLastManorHelpRecoverTimeAndCount(helpUserId, recoverTime, manorHelpCount);
    }

    public static boolean updateManorHelpCount(long helpUserId, int manorHelpCount) {
        return DaoHelper.getUserDaoImpl().updateManorHelpCount(helpUserId, manorHelpCount);
    }

    public static UserInfo getUserInfoListByAliasId(long userAliasId) {
        return DaoHelper.getUserDaoImpl().getUserInfoByAliasId(userAliasId);
    }

    public static List<UserInfo> getUserInfoByPlatformUserId(String platformUserId) {
        return DaoHelper.getUserDaoImpl().getUserInfoByPlatformUserId(platformUserId);
    }

    public static List<Long> getUserIdListByLastLoginTimeAndHasUnion(long lastLoginTime) {
        return DaoHelper.getUserDaoImpl().getUserIdListByLastLoginTimeAndHasUnion(lastLoginTime);
    }

    public static void getUserAbilityRank(int days, int titleId, List<UserInfo> userInfos, Map<Long, BigInteger> abilityMap) {
        DaoHelper.getUserDaoImpl().getUserAbilityRank(days, titleId, userInfos, abilityMap);
    }

    public static boolean destroyRole(long userId, String destroyRoleOpenId) {
        return DaoHelper.getUserDaoImpl().destroyRole(userId, destroyRoleOpenId);
    }

    public static long getRoleCreateCount() {
        return DaoHelper.getUserDaoImpl().getRoleCreateCount();
    }

    public static long getRoleCreateCount2(int level) {
        return DaoHelper.getUserDaoImpl().getRoleCreateCount2(level);
    }

    public static int getRegisterUserCount() {
        return DaoHelper.getUserDaoImpl().getRegisterUserCount();
    }

    public static Map<Long, UserInfo> getCreateRoleUserInfoMap() {
        return DaoHelper.getUserDaoImpl().getCreateRoleUserInfoMap();
    }
}
